package com.zxd.interfaces;

/**
 * ClassName:MyInterface
 * Package:com.zxd.interfaces
 *
 * @Date:2023/9/21 14:15
 * @Author:zxde
 */
//接口中的常量和抽象方法默认为public
public interface MyInterface {

    Integer STUDENT_AGE = 12;

    void say();

    //从JDK8开始接口中可以使用用default修饰的默认方法
    default void defaultMethod(){
        System.out.println("default Method run");
    }

    static void staticMethod(){
        System.out.println("static method run");
    }

    //从jdk9开始接口中可以定义私有方法，供default和static方法调用
/*    private void privateMethod(){
        System.out.println("private method run");

    }*/
}
